package com.jishuo.nontax.view.controller;

import com.jishuo.base.bean.BaseResult;
import com.jishuo.base.bean.vo.UserVO;
import com.jishuo.nontax.bean.vo.PayScaleBillVO;
import com.jishuo.nontax.bfc.service.CommBankService;
import com.jishuo.nontax.bfc.service.IllegalactivityinfoService;
import com.jishuo.nontax.bfc.service.PayScaleBillService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
import javax.servlet.http.HttpSession;
import java.util.Map;

/**
 * @auther dinggaofei
 * @Date 2023/3/28 10:43
 */
@Slf4j
@Controller
@RequestMapping(value = "/view/scalebill",name = "交管二八分成")
public class ScaleBillViewController {

    private  String  prefix = "view/";

    @Resource
    private PayScaleBillService payScaleBillService;


    @RequestMapping(value = {"scalebillview", "scalebillview/{page}"}, name = "交管二八分成柜面")
    public String index(@PathVariable(required = false) String page) {
        return prefix + ((page == null) ? "scalebillview" : page);
    }

    @ResponseBody
    @RequestMapping(value = "queryScaleBillView",name = "交管二八分成")
    public BaseResult queryScaleBillView(String billnum){
        return payScaleBillService.getIllegalactivityScale(billnum);
    }

    @ResponseBody
    @RequestMapping(value = "IllegalactivityDividepayview",name = "交管二八分成收款")
    public BaseResult IllegalactivityDividepayview (PayScaleBillVO payScaleBillVO, HttpSession session){
        UserVO user = (UserVO) session.getAttribute("login_user");
        return payScaleBillService.scalebillPay(payScaleBillVO,user);
    }
}
